> cal<-c(52, 160, 89, 57, 34, 32, 30, 69)
> car<-c(112.4, 8.5, 22.8, 14.5, 8.2, 7.7, 7.6, 18.1)
> fat<-c(0.2, 14.7, 1.3, 0.7, 0.2, 0.3, 0.2, 0.2)
> pro<-c(0.3, 2.0, 1.1, 0.3, 0.8, 0.7, 0.6, 0.7)
> fib<-c(2.4, 6.7, 2.6, 2.4, 0.9, 2.0, 0.4, 0.9)
> sug<-c(10.4, 0.7, 12.2, 9.9, 7.9, 4.7, 6.2, 15.5)
> fruits<-data.frame(cal, car, fat, pro, fib, sug)
> names<-c('apple', 'avocado', 'banana', 'blueberry', 'melon', 'watermelon', 'strawberry', 'grape’)
> rownames(fruits)<-names
> library(kohonen)
> fruits_scaled<-scale(fruits, center=T, scale=T)
# 자지조직지도 수행, 경쟁층의 노드 수는 1X3으로 3개
> result<-som(fruits_scaled, grid=somgrid(3, 1))
> par(mfrow=c(1, 2))
> plot(result)
> plot(result, type='mapping', labels=names)